﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace ProxyHero
{
    static class Program
    {
        [DllImport("user32.dll")]
        private static extern bool FlashWindow(IntPtr hWnd, bool bInvert);
        [DllImport("user32.dll")]
        private static extern bool FlashWindowEx(int pfwi);
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool runone;
            System.Threading.Mutex run = new System.Threading.Mutex(true, "ProxyHero", out runone);
            if (runone)
            {
                run.ReleaseMutex();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
 
                int hdc = Config.MainForm.Handle.ToInt32();
                Application.Run(Config.MainForm);
                IntPtr a = new IntPtr(hdc);
            }
            else
            {
                ProxyHero.Common.MsgBox.ShowMessage("已经运行了一个实例！");
            }
        }
    }
}
